package com.platform.system.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.platform.common.bean.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.persistence.Column;
import javax.persistence.Id;
import javax.validation.constraints.NotBlank;
import java.util.List;

/**
 * describe:菜单表实体类
 *
 * @author Administrator
 * @date 2019/11/19
 * @Time 23:37
 */
@ApiModel(value = "菜单", description = "菜单SysMenu")
@Data
@TableName(value = "sys_menu")
public class SysMenu extends BaseEntity<SysMenu> {

    /**
     * 主键
     */
    @ApiModelProperty(value = "主键", name = "menu_id", example = "32位uuid", required = true)
    @Id
    @Column(name = "menu_id", length = 20, columnDefinition = "varchar(50) COMMENT '主键'")
    @TableId(type = IdType.ASSIGN_ID)
    private String menuId;
    /**
     * 所属的系统编码
     */
    @ApiModelProperty(value = "菜单编码", name = "code", example = "菜单编码", required = true)
    @Column(name = "code", length = 50, columnDefinition = "varchar(50) COMMENT '菜单编码'")
    @NotBlank(message = "菜单编码不能为空")
    private String code;
    /**
     * 所属的系统编码
     */
    @ApiModelProperty(value = "所属的系统编码", name = "sys_code", example = "所属的系统编码", required = true)
    @Column(name = "sys_code", length = 100, columnDefinition = "varchar(50) COMMENT '所属的系统编码'")
    @NotBlank(message = "系统编码不能为空")
    private String sysCode;
    /**
     * 菜单路径
     */
    @ApiModelProperty(value = "菜单路径", name = "menu_url", example = "菜单路径", required = true)
    @Column(name = "menu_url", length = 100, columnDefinition = "varchar(100) COMMENT '菜单路径'")
    private String menuUrl;
    /**
     * 菜单名称
     */
    @ApiModelProperty(value = "菜单名称", name = "menu_name", example = "菜单名称", required = true)
    @Column(name = "menu_name", length = 100, columnDefinition = "varchar(100) COMMENT '菜单名称'")
    @NotBlank(message = "菜单名称不能为空")
    private String menuName;
    /**
     * 排序顺序
     */
    @ApiModelProperty(value = "排序顺序", name = "orderNum", example = "排序顺序", required = true)
    @Column(name = "order_num", length = 10, columnDefinition = "int(10) COMMENT '排序顺序'")
    private Integer orderNum;
    /**
     * 父级
     */
    @ApiModelProperty(value = "父级", name = "parentId", example = "父级", required = true)
    @Column(name = "parent_id", length = 32, columnDefinition = "varchar(32) COMMENT '菜单名称'")
    private String parentId;
    /**
     * 层级
     */
    @ApiModelProperty(value = "层级", name = "parent_ids", example = "层级", required = true)
    @Column(name = "parent_ids", length = 200, columnDefinition = "varchar(200) COMMENT '层级'")
    private String parentIds;
    /**
     * 图标
     */
    @ApiModelProperty(value = "图标", name = "menu_icon", example = "层级", required = true)
    @Column(name = "menu_icon", length = 50, columnDefinition = "varchar(50) COMMENT '图标'")
    private String menuIcon;

    /**
     * 标记是否删除
     */
    @ApiModelProperty(value = "标记", name = "flag", example = "标记(diabale 删除 unable 正常)", required = true)
    @Column(name = "flag", length = 20, columnDefinition = "varchar(20) COMMENT '标记(diabale 删除 unable 正常)'")
    @TableField(fill = FieldFill.INSERT)
    private String flag;

    /**
     * 子菜单
     */
    @TableField(exist = false)
    private List<SysMenu> childMenus;
}
